﻿using System;
using Company.BLL;
using Company.BLL.GC;
using Company.BLL.Utils;
using Company.BLL.DuLieuChuan;
using Janus.Windows.GridEX;

namespace Company.Interface.GC.PCTFormTemplate
{
    public partial class PKBoSungTBFormRegister : BaseForm
    {
        public PhuKienDangKy pkdk;
        public string FormName;
        public PKBoSungTBFormRegister()
        {
            InitializeComponent();
        }
       
      


       

        private void PKChiTietMaSPForm_Load(object sender, EventArgs e)
        {
            pkdk.Load();
            txtGhiChu.Text = pkdk.GhiChu;
            txtVBCP.Text = pkdk.VBCP;
            this.Text = FormName;
            txtMaDV.Text = GlobalSettings.MA_DON_VI;
            txtTen.Text = GlobalSettings.TEN_DON_VI;
            txtSoHopDong.Text = pkdk.SoHopDong;
            txtSoPhuKien.Text = pkdk.SoPhuKien.ToString();
            txtNgayKyHD.Text = pkdk.NgayKy.ToShortDateString();
            ccNgayPhuKien.Text = pkdk.NgayPhuKien.ToShortDateString();
            ctrDonViHaiQuan.Ma = pkdk.MahaiQuan;
            PhuKien pk = new PhuKien();
            pk.MaDoanhNghiep = pkdk.MaDoanhNghiep;
            pk.MahaiQuan = pkdk.MahaiQuan;
            pk.MaPhuKien = pkdk.MaPhuKien;
            pk.NgayKy = pkdk.NgayKy;            
            pk.SoPhuKien = pkdk.SoPhuKien;
            pk.SoHopDong = pkdk.SoHopDong;
            dgList.DataSource = pk.SelectCollectionBy_SoHopDong_AND_MahaiQuan_AND_MaDoanhNghiep_GC_AND_NgayKy_AND_SoPhuKien_AND_MaPhuKien();     
  
        }

      

        private void dgThietBi_DeletingRecord(object sender, Janus.Windows.GridEX.RowActionCancelEventArgs e)
        {
           
        }

        private void dgThietBi_LoadingRow(object sender, Janus.Windows.GridEX.RowLoadEventArgs e)
        {
            e.Row.Cells[6].Text = this.DonViTinh_GetName(e.Row.Cells[5].Value);
            e.Row.Cells[14].Text = this.NguyenTe_GetName(e.Row.Cells[10].Value);
            e.Row.Cells[15].Text = this.Nuoc_GetName(e.Row.Cells[11].Value);            
    
        }

        private void dgThietBi_RowDoubleClick(object sender, Janus.Windows.GridEX.RowActionEventArgs e)
        {
            
        }
       
    }
}